package executeEngine.methodInvoke.staticDispatch;

class Human {}
class Man extends Human {}
class Woman extends Human {}

public class Demo1 {

    void sayHello(Human m) {
        System.out.println("Hey human!");
    }

    void sayHello(Man m) {
        System.out.println("Hey man!");
    }

    void sayHello(Woman m) {
        System.out.println("Hey woman!");
    }

    public static void main(String[] args) {
        Human m1 = new Man();
        Human m2 = new Woman();
        Demo1 demo1 = new Demo1();
        demo1.sayHello(m1);
        demo1.sayHello(m2);
    }
}
